package com.cn.springcloudwechat.mapper.mapper;

import com.cn.springcloudwechat.common.mybatis.Page;
import com.cn.springcloudwechat.model.YmUser;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface YmUserMapper {


    int deleteByPrimaryKey(Long userId);

    int insert(YmUser record);

    int insertSelective(YmUser record);

    YmUser selectByPrimaryKey(Long userId);

    int updateByPrimaryKeySelective(YmUser record);

    int updateByPrimaryKey(YmUser record);

    /**
     * 根据openid获取用户
     * @param openId
     * @return
     */
    YmUser getUserByOpenId(String openId);

    /**
     * 根据电话号码获取用户
     * @param phone
     * @return
     */
    YmUser getUserByPhone(String phone);

    /**
     * 获取所有用户
     * @return
     */
    List<YmUser> getUserList(@Param("ymUser") YmUser ymUser, Page<YmUser> page);

    /**
     * 启用禁用用户
     * @param userId
     */
    void updateUserState(@Param("state") Integer state,@Param("userId")String[] userId);

}